<extend name="Base/common" />
<block name="header">
<header class="jumbotron subhead" id="overview">
<!--  <div class="container">
    <h2>用戶登錄</h2>
    <p><span><span class="pull-left"><span>還沒有賬號? <a href="{:U('User/register')}">立即註冊</a></span> </span></p>
  </div>
</header>-->
</block>

<block name="body">
    <div class="modal fade" id="signin" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-sm">
                <div class="modal-content">
                    <div class="modal-header">
                        <h4 class="modal-title" id="signinLabel">會員登錄</h4>
                    </div>
                    <div class="modal-body">
                        <form  role="form" id="userLoginForm" method="post" action="{:U('Home/User/login','','')}">
                            <div class="form-group">
                                <input type="text" name="usernameSignin" id="usernameSignin" placeholder="會員帳號" class="form-control">
                            </div>
                            <div class="form-group">
                                <input type="password" name="passwordSignin" id="passwordSignin" placeholder="密碼" class="form-control">
                            </div>
                            <div class="form-group">
                                <div class="row">
                                    <div class="col-xs-6">
                                        <div class="checkbox custom-checkbox"><label><input type="checkbox" id="rememberSignin" name="rememberme" value="forever"><span class="fa fa-check"></span>記住我</label></div>
                                    </div>
                                    <div class="col-xs-6 align-right">
                                        <p class="help-block"><a href="#" class="text-green forgotPass">忘記密碼?</a></p>
                                    </div>
                                </div>
                            </div>
                            <input type="hidden" id="securitySignin" name="securitySignin" ><input type="hidden" name="_wp_http_referer" value="/themes/reales-wp/">                    <div class="form-group">
                                <div class="btn-group-justified">
                                    <a href="javascript:void(0)" class="btn btn-lg btn-green" id="submitSignin">登錄</a>
                                </div>
                            </div>
                            <p class="help-block">沒有帳號? <a href="#signup" class="modal-su text-green" data-toggle="modal" >註冊</a></p>
                        </form>
                    </div>
                </div>
            </div>
    </div>
    
<!--<section>
	<div class="span12">
        <form class="login-form" action="__SELF__" method="post">
          <div class="control-group">
            <label class="control-label" for="inputEmail">用戶名</label>
            <div class="controls">
              <input type="text" id="inputEmail" class="span3" placeholder="請輸入用戶名"  ajaxurl="/member/checkUserNameUnique.html" errormsg="請填寫1-16位用戶名" nullmsg="請填寫用戶名" datatype="*1-16" value="" name="username">
            </div>
          </div>
          <div class="control-group">
            <label class="control-label" for="inputPassword">密碼</label>
            <div class="controls">
              <input type="password" id="inputPassword"  class="span3" placeholder="請輸入密碼"  errormsg="密碼為6-20位" nullmsg="請填寫密碼" datatype="*6-20" name="password">
            </div>
          </div>
          <div class="control-group">
            <label class="control-label" for="inputPassword">驗證碼</label>
            <div class="controls">
              <input type="text" id="inputPassword" class="span3" placeholder="請輸入驗證碼"  errormsg="請填寫5位驗證碼" nullmsg="請填寫驗證碼" datatype="*5-5" name="verify">
            </div>
          </div>
          <div class="control-group">
            <label class="control-label"></label>
            <div class="controls">
                <img class="verifyimg reloadverify" alt="點擊切換" src="{:U('verify')}" style="cursor:pointer;">
            </div>
            <div class="controls Validform_checktip text-warning"></div>
          </div>
          <div class="control-group">
            <div class="controls">
              <label class="checkbox">
                <input type="checkbox"> 自動登陸
              </label>
              <button type="submit" class="btn">登 陸</button>
            </div>
          </div>
        </form>
	</div>
</section>-->
</block>

<block name="side"> </block>
<block name="script">
	<script type="text/javascript">

    	$(document)
	    	.ajaxStart(function(){
	    		$("button:submit").addClass("log-in").attr("disabled", true);
	    	})
	    	.ajaxStop(function(){
	    		$("button:submit").removeClass("log-in").attr("disabled", false);
	    	});


    	$("form").submit(function(){
    		var self = $(this);
    		$.post(self.attr("action"), self.serialize(), success, "json");
    		return false;

    		function success(data){
    			if(data.status){
    				window.location.href = data.url;
    			} else {
    				self.find(".Validform_checktip").text(data.info);
    				//刷新驗證碼
    				$(".reloadverify").click();
    			}
    		}
    	});

		$(function(){
			var verifyimg = $(".verifyimg").attr("src");
            $(".reloadverify").click(function(){
                if( verifyimg.indexOf('?')>0){
                    $(".verifyimg").attr("src", verifyimg+'&random='+Math.random());
                }else{
                    $(".verifyimg").attr("src", verifyimg.replace(/\?.*$/,'')+'?'+Math.random());
                }
            });
		});
	</script>
</block>